<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="true"                                                             %>
<%@ page import="com.teamTPZoo.Context.TPZooContext"                                %>
<%@ page import="com.teamTPZoo.Constants.ConstantsIF"                               %>
<%@ page import="com.teamTPZoo.DB.TPZooDB"                                          %>
<%@ page import="net.sf.json.*"                                                     %>
<%@ page import="java.sql.*"                                                        %>
<%

    TPZooContext ctx        = new TPZooContext( request, true );

    TPZooDB      db         = new TPZooDB( ConstantsIF.DB_DBMS, ConstantsIF.DB_IP, ConstantsIF.DB_USER, ConstantsIF.DB_PASS, ConstantsIF.DB_PORT, ConstantsIF.DB_DB, ConstantsIF.DB_AUTO, ConstantsIF.DB_DEBUG );
    JSONObject   JSON_xxxx  = (JSONObject)db.dbQueryJSON("EXEC SP_TBLMATERIAL_GETLIST @Rating_UID='2', @ConKind_UID='1', @ConKindSub_UID='1' ");
    JSONObject   JSON_xxxx2 = (JSONObject)db.dbQueryJSON("SELECT 1, 2, 3, 'a', 'b', 'c'");
    ResultSet    tmpRS      = db.dbQueryRS("SELECT * FROM tblCon WHERE tblCon_UID < 10" );
    
    String     tmp           = "pipiband";
    
    JSONObject JSON_x = new JSONObject();
    JSONArray JAx = new JSONArray();
    for ( int i=0; i<10; i++ ) {
        //JAx.put( "U" );        
        
        JAx.add( i );
    }
    
    JSON_x.put("x", "valueX");
    JSON_x.put("y", "valueY");
    
    JSONObject JSON_sub = new JSONObject();
    JSON_sub.put("SUB1", "value_SUB1");
    JSON_sub.put("SUB2", "value_SUB2");
    
    JSON_x.put("sub", JSON_sub);
    JSON_x.put("JAx", JAx);
    
    out.println(JSON_x.toString()+"<br />");


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
ctx.getLocalName() = <%=ctx.getLocalName()%><br />
ctx.getParameter("tempX", "") = <%=ctx.getParameter("tempX", "") %><br />

</body>
</html>